<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>3-1 Vue.directive</title>
</head>
<body>
  <div id="app">
    <input type="text" v-focus="true">
  </div>
</body>
<script src="./js/vue.js"></script>
<script>
  Vue.directive('focus',{
    inserted(el, binding) {
      if (binding.value) {
        el.focus();
      }
    }
  })
  new Vue({
    el:'#app'
  })

</script>
</html>